package com.titanrise.crm.mapper;

import com.titanrise.crm.domain.model.Product;
import com.titanrise.crm.environment.annotation.*;

/**
 * @Description:
 * @Author: pront
 * @Time:2024-12-01 10:02
 */
@Mapper
public interface ProductMapper {


    @Select("select * from tb_product where id = #{productId}")
    @ResultType(Product.class)
    Product selectById(@Param("productId") String productId);

    @Update("update tb_product set stock = #{newStock} where id = #{productId}")
    int updateStockById(@Param("productId") String productId, @Param("newStock") int newStock);
}
